package k8s

import (
	"goproject/logger"
)

type ChaosStatus struct {
	Selected     bool
	AllInjected  bool
	AllRecovered bool
	Paused       bool
}

// IsInChaos 是否处在混沌故障中
func (cs ChaosStatus) IsInChaos() bool {
	// FIXME 选中、注入、未恢复、未暂停
	return cs.Selected && cs.AllInjected && !cs.AllRecovered && !cs.Paused
}

// IsOutChaos 是否从故障中恢复
func (cs ChaosStatus) IsOutChaos() bool {
	log := logger.GetLogger()
	log.Debugf("IsOutChaos %#v", cs)
	// 当前未注入、已恢复
	return !cs.AllInjected && cs.AllRecovered
}

// TODO 各种异常情况
